<!-- <template>
  <span>{{ options[value] || '未知状态' }}</span>
</template>

<script>
export default {
  props: {
    options: {
      type: Object,
      required: true
    },
    value: {
      type: [String, Number],
      required: true
    }
  }
};
</script> -->

<template>
  <el-tag :style="{ backgroundColor: color, color: '#fff' }">
    {{ label }}
  </el-tag>
</template>

<script>
export default {
  props: {
    options: Array,
    value: Number
  },
  computed: {
    label() {
      const option = this.options.find(opt => opt.value === this.value);
      return option ? option.label : '未知状态';
    },
    color() {
      const option = this.options.find(opt => opt.value === this.value);
      return option ? option.color : 'grey';
    }
  }
};
</script>
